﻿using System;
using System.ComponentModel.DataAnnotations;

namespace Deepcode.ValidationSample.Controllers
{
	[AttributeUsage( AttributeTargets.Property )]
	public class IsNotTonyJohnsonAttribute : ValidationAttribute
	{
		public override bool IsValid(object value)
		{
			if( value == null ) return true;
			if( value.ToString() == "Tony Johnson" ) return false;
			return true;
		}
	}
}